/******************************************************************************
copyright(c)cguage.com
source code can be free to use and publish, but please keep header comments, thx

author:  cguage
contact: tangcraig@gmail.com
desc:    missing
date:    unknown

*******************************************************************************/
#pragma once
#include <fstream>

class WriteLog : public Job {
protected:
    string name() {return "WriteLog";}

    void onInit() {
        _logFile.open("out.log", ios::app);
    }

    void run(const string& strParams) {
        if (!strParams.empty()) {
            cout << name() << ": " << strParams << endl;
            _logFile << strParams << endl;
        }
    }

private:
    ofstream _logFile;
} _end_WriteLog;